package com.xiaoluo.lottery.common.weixin.pay;


import com.squareup.okhttp.Response;
import com.xiaoluo.lottery.common.weixin.base.BaseRes;
import com.xiaoluo.lottery.common.weixin.pay.beans.*;
import retrofit.http.*;

/**
 * Project : lottery
 * Package : main.java.com.xiaoluo.lottery.common.weixin.pay
 * Created by Willian.
 * Date  : 2016/4/6 16:45.
 * 微信支付Api
 * 接口API : https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=1_1
 */
public interface IWeiXinPay {


    /**
     * 统一下单
     * @param req
     * @return
     * @throws Exception
     * https://api.mch.weixin.qq.com/pay/unifiedorder
     */
    @POST("/pay/unifiedorder")
    UnifiedOrderRes unifiedorder(@Body UnifiedOrderReq req,@Query("access_token") String accessToken) throws Exception;

    /**
     * 测试接口
     * @param req
     * @param accessToken
     * @return
     * @throws Exception
     */
    @POST("/pay/unifiedorder")
    UnifiedOrderRes test(@Body TestReq req,@Query("access_token") String accessToken) throws Exception;

    /**
     * 查询订单
     * @param req
     * @return
     * @throws Exception
     * https://api.mch.weixin.qq.com/pay/orderquery
     */
    @POST("/pay/orderquery")
    OrderQueryRes orderquery(@Body OrderQueryReq req) throws Exception;

    /**
     * 关闭订单
     * @param req
     * @return
     * @throws Exception
     * https://api.mch.weixin.qq.com/pay/closeorder
     */
    @POST("/pay/closeorder")
    CloseOrderRes closeorder(@Body CloseOrderReq req) throws Exception;


    /**
     * 申请退款
     * 需双向证书
     * @param req
     * @return
     * @throws Exception
     * https://api.mch.weixin.qq.com/secapi/pay/refund
     */
    @POST("/secapi/pay/refund")
    RefundRes refund(@Body RefundReq req) throws Exception;


    /**
     * 查询退款
     * @param req
     * @return
     * @throws Exception
     * https://api.mch.weixin.qq.com/pay/refundquery
     */
    @POST("/pay/refundquery")
    RefundQueryRes refundquery(@Body RefundQueryReq req) throws Exception;

    /**
     * 测试上报
     * @param req
     * @return
     * @throws Exception
     * https://api.mch.weixin.qq.com/payitil/report
     */
    @POST("/payitil/report")
    BaseRes report(@Body ReportReq req) throws Exception;

    /**
     * 下载账单
     * @param req
     * @return
     * @throws Exception
     * https://api.mch.weixin.qq.com/pay/downloadbill
     */
    @POST("pay/downloadbill")
    Response downloadbill(@Body DownloadBillReq req) throws Exception;

}
